import { Entity, PrimaryGeneratedColumn, Column } from "typeorm";
import { ManualTimestamp } from "../decorators/manual-timestamp.decorator";

@Entity("gem_mining")
@ManualTimestamp()
export class GemMiningEntity {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column("varchar", { length: 50, comment: "矿洞名称" })
  name!: string;

  @Column("int", { comment: "矿洞类型：1-原矿，2-精矿，3-珍矿" })
  type!: number;

  @Column("int", { name: "key_item_id", comment: "所需钥匙物品ID" })
  keyItemId!: number;

  @Column("varchar", {
    length: 100,
    name: "key_item_name",
    comment: "钥匙名称",
  })
  keyItemName!: string;

  @Column("int", { name: "min_level", comment: "最低宝石等级" })
  minLevel!: number;

  @Column("int", { name: "max_level", comment: "最高宝石等级" })
  maxLevel!: number;

  @Column("text", { name: "gem_types", comment: "可获得的宝石类型列表" })
  gemTypes!: string;

  @Column("varchar", { length: 200, comment: "矿洞描述" })
  description!: string;

  @Column("tinyint", { default: 1, comment: "状态：0-禁用，1-启用" })
  status!: number;

  @Column("datetime", { name: "created_at", comment: "创建时间" })
  created_at!: Date;

  @Column("datetime", { name: "updated_at", nullable: true, comment: "更新时间" })
  updated_at!: Date | null;
}
